﻿<%@ Page Title="" Language="C#" MasterPageFile="~/_Default.Master" AutoEventWireup="true" ValidateRequest="false" CodeBehind="Edit.aspx.cs" Inherits="WebApplication.Project.Edit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <link href="../Content/Css/ArtNew.css" rel="stylesheet" />
    <link href="../Content/Css/inputTag.css" rel="stylesheet" />
    <script src="../Content/Scripts/projectNew.js"></script>
    <script src="../Content/Scripts/ueditor/ueditor.config.js"></script>
    <script src="../Content/Scripts/ueditor/ueditor.all.js"></script>
    <script>
        let typeTag = null, styleTag = null;
        let ue = null;
        let deadline = "";
        let typeTagData = [];
        let styleTagData = [];
        $(function () {
         

        <% if (project.Owner != null)
        {%>
            const tagData = <%=project.Tag%>;
            typeTagData = tagData.splice(0, tagData.indexOf("@"));
            styleTagData = tagData.splice(1, tagData.length);
            deadline = new Date("<%=project.Deadline%>");
            ue.ready(() => {
                ue.setContent('<%=project.Content%>')
            })
        <%}%>
        })
        
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="layui-row" style="width: 1200px;">
        <div class="layui-col-md10 layui-col-md-offset1 layui-col-sm10 layui-col-sm-offset1">
            <div class="layui-card">
                <div class="layui-card-header">发布插画约稿</div>
                <div class="layui-card-body">
                    <%--身份--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label">身份</label>
                        <div>
                            <input type="radio" name="identity" value="1" title="私人" checked="" />
                            <input type="radio" name="identity" value="2" title="社区/店铺" />
                            <input type="radio" name="identity" value="3" title="公司企业" />
                        </div>

                        <% if (project.Owner != null)
                            { %>
                        <script>
                            $(function () {
                                const identity = <%=project.Identity%>;
                                $(`[name="identity"][value="${identity}"]`).prop('checked', true);
                                layui.form.render()
                            })
                        </script>
                        <%} %>
                    </div>

                    <%--怎么称呼--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label">怎么称呼</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm6 layui-col-md6">
                                <input value="<%=project.Name %>" type="text" name="name" lay-verify="name" autocomplete="off" placeholder="" class="layui-input" maxlength="20" />
                            </div>
                            <div class="layui-col-sm6 layui-col-md6">
                                <div class="text-muted ml-10">*名称长度20字以内</div>
                            </div>
                        </div>
                    </div>

                    <%--标题--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label required">标题</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm6 layui-col-md6">
                                <input value="<%=project.Title %>" type="text" name="title" lay-verify="required" lay-reqtext="请输入标题" autocomplete="off" placeholder="" class="layui-input" maxlength="30" />
                            </div>
                            <div class="layui-col-sm6 layui-col-md6">
                                <div class="text-muted ml-10">*标题长度30字以内</div>
                            </div>
                        </div>
                    </div>

                    <%--类型标签--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label">类型标签</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm6 layui-col-md6">
                                <div class="fairy-tag-container">
                                    <input type="text" class="fairy-tag-input typeTag" autocomplete="off" value="" maxlength="10" />
                                </div>
                            </div>
                            <div class="layui-col-sm6 layui-col-md6">
                                <div class="text-muted ml-10">*最多3个</div>
                            </div>
                        </div>
                        <div class="flex-container fairy-tag-container border-none">
                            <div class="flex-shrink-0">常用:</div>
                            <div class="flex-grow-1" id="typeTag_id">
                            </div>
                        </div>
                    </div>

                    <%--风格标签--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label">风格标签</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm6 layui-col-md6">
                                <div class="fairy-tag-container">
                                    <input type="text" class="fairy-tag-input styleTag" autocomplete="off" value="" maxlength="10" />
                                </div>
                            </div>
                            <div class="layui-col-sm6 layui-col-md6">
                                <div class="text-muted ml-10">*最多3个</div>
                            </div>
                        </div>
                        <div class="flex-container fairy-tag-container border-none">
                            <div class="flex-shrink-0">常用:</div>
                            <div class="flex-grow-1" id="styleTag_id">
                            </div>
                        </div>
                    </div>

                    <%--单张预算--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label required">单张预算</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm6 layui-col-md6">
                                <div class="layui-input-inline" style="width: 100px;">
                                    <input value="<%=project.PriceMin %>" type="text" name="priceMin" placeholder="￥" autocomplete="off" class="layui-input" lay-verify="priceMin" />
                                </div>
                                <div class="layui-form-mid">-</div>
                                <div class="layui-input-inline" style="width: 100px;">
                                    <input value="<%=project.PriceMax %>" type="text" name="priceMax" placeholder="￥" autocomplete="off" class="layui-input" lay-verify="priceMax" />
                                </div>
                                <div class="layui-form-mid">元</div>
                            </div>
                        </div>
                    </div>

                    <%--截稿日期--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label required">截稿日期</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm6 layui-col-md6">
                                <input readonly="readonly" name="Deadline" type="text" class="layui-input" id="endTime" placeholder="截稿日期" lay-verify="required" lay-reqtext="请选择截稿日期" />
                            </div>
                        </div>
                    </div>

                    <%--合作流程--%>
                    <div class="layui-form-item" style="display: none;">
                        <label class="layui-form-label">合作流程</label>
                        <div>
                            <input type="radio" name="access" value="0" title="由我选定画师自行联系" checked="" />
                            <input type="radio" name="access" value="1" title="请画师主动联系我" />
                        </div>
                    </div>

                    <%--联系方式--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label">联系方式</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm6 layui-col-md6">
                                <input value="<%=project.Contact %>" type="text" name="contact" lay-verify="contact" autocomplete="off" placeholder="" class="layui-input" maxlength="50" />
                            </div>
                            <div class="layui-col-sm5 layui-col-md5 layui-col-md-offset1 layui-col-sm-offset1" style="display: none;">
                                <input type="checkbox" name="like1[write]" lay-skin="primary" title="应征后可见" />
                            </div>
                        </div>
                    </div>


                    <%--需求详情--%>
                    <div class="layui-form-item">
                        <label class="layui-form-label required">需求详情</label>
                        <div class="layui-row layui-form-item">
                            <div class="layui-col-sm12 layui-col-md12" id="ueditor">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item text-center">
                        <button type="button" class="layui-btn layui-btn-danger-2" lay-submit="" lay-filter="form">
                            
                            <% if (project.Owner != null)
                                {%>
                                编辑需求
                            <%}
                                else
                                { %>
                                发布需求
                            <%} %>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

</asp:Content>
